import Layout from "@/pages/Layout";
import Login from "@/pages/Login";
import { createBrowserRouter } from "react-router-dom";
import  {AuthRoute}  from "@/component/AuthRouter"
import Home from "@/pages/Home";
import Article from "@/pages/Article";
import Public from "@/pages/Public";

const router = createBrowserRouter([
  {
    path: "/",
    element: <AuthRoute>
      <Layout />
      </AuthRoute>,
      children:[
        {
          //path:'home',
          index: true, // 默认子路由
          element:<Home />
        },
                {
          path:'article',
          element:<Article />
        },
                {
          path:'public',
          element:<Public />
        }
      ]
  },
  {
    path: "/login",
    element: <Login />,
  },
]);
export default router;
